import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Login from './views/Login.vue'
import Test from './views/Test.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/',
      name: 'home',
      component: Home,
      redirect: '/Dashboard',
      children: [
        {
          path: 'dashboard',
          name: 'dashboard',
          component: () => import(/* webpackChunkName: "dashboard" */ './views/Dashboard.vue')
        },
        {
          path: 'hardware:id',
          name: 'hardware',
          component: () => import(/* webpackChunkName: "hardware" */ './views/Hardware.vue')
        },
        {
          path: 'password',
          name: 'password',
          component: () => import(/* webpackChunkName: "password" */ './views/Password.vue')
        },
        {
          path: 'create',
          name: 'create',
          component: () => import(/* webpackChunkName: "create" */ './views/Create.vue')
        },
        {
          path: 'manufacturers',
          name: 'manufacturers',
          component: () => import(/* webpackChunkName: "manufacturers" */ './views/Manufacturers.vue')
        },
        {
          path: 'models',
          name: 'models',
          component: () => import(/* webpackChunkName: "models" */ './views/Models.vue')
        },
        {
          path: 'categories',
          name: 'categories',
          component: () => import(/* webpackChunkName: "categories" */ './views/Categories.vue')
        },
        {
          path: 'suppliers',
          name: 'suppliers',
          component: () => import(/* webpackChunkName: "suppliers" */ './views/Suppliers.vue')
        },
        {
          path: 'departments',
          name: 'departments',
          component: () => import(/* webpackChunkName: "departments" */ './views/Departments.vue')
        },
        {
          path: 'companies',
          name: 'companies',
          component: () => import(/* webpackChunkName: "companies" */ './views/Companies.vue')
        },
        {
          path: 'components',
          name: 'components',
          component: () => import(/* webpackChunkName: "components" */ './views/Components.vue')
        },
        {
          path: 'users',
          name: 'users',
          component: () => import(/* webpackChunkName: "users" */ './views/Users.vue')
        },
        {
          path: 'peripheral',
          name: 'peripheral',
          component: () => import(/* webpackChunkName: "peripheral" */ './views/Peripheral.vue')
        },
        {
          path: 'consumables',
          name: 'consumables',
          component: () => import(/* webpackChunkName: "consumables" */ './views/Consumables.vue')
        },
        {
          path: 'license',
          name: 'license',
          component: () => import(/* webpackChunkName: "license" */ './views/License.vue')
        },
        {
          path: 'depreciation',
          name: 'depreciation',
          component: () => import(/* webpackChunkName: "depreciation" */ './views/Depreciation.vue')
        },
        {
          path: 'report',
          name: 'report',
          component: () => import(/* webpackChunkName: "report" */ './views/Report.vue')
        }
      ]
    },
    {
      path: '/test',
      name: 'test',
      component: Test
    },
    {
      path: '/test/:name',
      name: 'test',
      component: Test
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    }
  ]
})
